package Util;

public class Page {
    public static int PAGESIZE = 10;
    private int num;
    private int total;
    private int maxnum;

    public int getMaxnum() {
        if(total%PAGESIZE==0){
            maxnum = total/PAGESIZE;
        }
        else {
            maxnum = total/PAGESIZE+1;
        }

        return maxnum;

    }

    @Override
    public String toString() {
        return "Page{" +
                "num=" + num +
                ", total=" + total +
                ", maxnum=" + getMaxnum() +
                '}';
    }

    public Page(int num, int total) {
        this.num = num;
        this.total = total;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void setMaxnum(int maxnum) {
        this.maxnum = maxnum;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }
}
